package com.example.ssm.controller;

import com.example.ssm.bean.Employee;
import com.example.ssm.dao.EmployeeMapper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class HelloController {
    @Resource
    EmployeeMapper employeeMapper;

    @ResponseBody
    @GetMapping("/hello")
    public Employee hello(){
        Employee employee = employeeMapper.selectByPrimaryKeyWithDepName(1);
        return employee;
    }
}
